<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  

  
  <title>HTML进阶知识点--HTML5属性变化 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="input标签type属性新增属性值   属性值 作用    tel 手机端不同   email 手机端键盘出现@   number 出现按钮，可以加减   url 手机端键盘出现.com   Date 选取日、月、年   Month 选取月、年   Week 选取周和年 不实用   Time 选取时间（小时和分钟）   Datatime 选取时间、日、月、年（UTC时间） 不实用   Data">
<meta name="keywords" content="HTML5">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML进阶知识点--HTML5属性变化">
<meta property="og:url" content="http://yoursite.com/2019/08/11/HTML进阶知识点-HTML5属性变化/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="input标签type属性新增属性值   属性值 作用    tel 手机端不同   email 手机端键盘出现@   number 出现按钮，可以加减   url 手机端键盘出现.com   Date 选取日、月、年   Month 选取月、年   Week 选取周和年 不实用   Time 选取时间（小时和分钟）   Datatime 选取时间、日、月、年（UTC时间） 不实用   Data">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-08-13T06:31:56.124Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML进阶知识点--HTML5属性变化">
<meta name="twitter:description" content="input标签type属性新增属性值   属性值 作用    tel 手机端不同   email 手机端键盘出现@   number 出现按钮，可以加减   url 手机端键盘出现.com   Date 选取日、月、年   Month 选取月、年   Week 选取周和年 不实用   Time 选取时间（小时和分钟）   Datatime 选取时间、日、月、年（UTC时间） 不实用   Data">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-HTML进阶知识点-HTML5属性变化" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/08/11/HTML进阶知识点-HTML5属性变化/" class="article-date">
  <time datetime="2019-08-11T07:57:56.000Z" itemprop="datePublished">2019-08-11</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/HTML5/">HTML5</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      HTML进阶知识点--HTML5属性变化
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <hr>
<h2 id="input标签type属性新增属性值"><a href="#input标签type属性新增属性值" class="headerlink" title="input标签type属性新增属性值"></a>input标签type属性新增属性值</h2><table>
<thead>
<tr>
<th>属性值</th>
<th>作用</th>
</tr>
</thead>
<tbody><tr>
<td>tel</td>
<td>手机端不同</td>
</tr>
<tr>
<td>email</td>
<td>手机端键盘出现@</td>
</tr>
<tr>
<td>number</td>
<td>出现按钮，可以加减</td>
</tr>
<tr>
<td>url</td>
<td>手机端键盘出现<code>.com</code></td>
</tr>
<tr>
<td>Date</td>
<td>选取日、月、年</td>
</tr>
<tr>
<td>Month</td>
<td>选取月、年</td>
</tr>
<tr>
<td>Week</td>
<td>选取周和年 <font color="red">不实用</font></td>
</tr>
<tr>
<td>Time</td>
<td>选取时间（小时和分钟）</td>
</tr>
<tr>
<td>Datatime</td>
<td>选取时间、日、月、年（UTC时间） <font color="red">不实用</font></td>
</tr>
<tr>
<td>Datatime-local</td>
<td>选取时间、日、月、年（本地时间）</td>
</tr>
<tr>
<td>range</td>
<td>一个可拉伸的进度条（pc端）</td>
</tr>
<tr>
<td>search</td>
<td>搜索框（pc端）</td>
</tr>
<tr>
<td>color</td>
<td>颜色选择框（pc端）</td>
</tr>
</tbody></table>
<h2 id="表单新增属性"><a href="#表单新增属性" class="headerlink" title="表单新增属性"></a>表单新增属性</h2><h3 id="autocomplete属性"><a href="#autocomplete属性" class="headerlink" title="autocomplete属性"></a>autocomplete属性</h3><p>form 或 input 域应该拥有自动完成功能</p>
<blockquote>
<p><code>&lt;form autocomplete=&quot;on&quot;&gt;&lt;/form&gt;</code></p>
</blockquote>
<p>注意：autocomplete 适用于 <code>&lt;form&gt;</code> 标签，以及以下类型的 <code>&lt;input&gt;</code> 标签：text、search、url、telephone、email、password、datepickers、range、color</p>
<h3 id="autofocus属性"><a href="#autofocus属性" class="headerlink" title="autofocus属性"></a>autofocus属性</h3><ul>
<li><p>规定在页面加载时，域自动地获取焦点</p>
</li>
<li><p>autofocus 属性适用于所有 <code>&lt;input&gt;</code> 标签的类型</p>
</li>
</ul>
<p>语法：</p>
<blockquote>
<p><code>&lt;input autofocus=&quot;autofocus&gt;</code></p>
</blockquote>
<h3 id="multiple属性"><a href="#multiple属性" class="headerlink" title="multiple属性"></a>multiple属性</h3><p>规定输入域中可选择多个值</p>
<p>PS：multiple 属性适用于以下类型的 <code>&lt;input&gt;</code> 标签：email 和 file</p>
<blockquote>
<p><code>&lt;input type=&quot;file&quot; multiple=&quot;multiple&quot;&gt;</code></p>
</blockquote>
<h3 id="placeholder属性"><a href="#placeholder属性" class="headerlink" title="placeholder属性"></a>placeholder属性</h3><p>提供一种提示（hint），描述输入框所期待的值</p>
<p>PS：适用于 <code>&lt;input&gt;</code> 标签 type 属性值为：text、search、url、tel、email、password</p>
<h3 id="required属性"><a href="#required属性" class="headerlink" title="required属性"></a>required属性</h3><p>规定必须在提交之前填写输入域（不能为空）</p>
<blockquote>
<p><code>&lt;input type=&quot;text&quot; required=&quot;required&quot;&gt;</code></p>
</blockquote>
<p>减少前端开发人员写表单验证的压力</p>
<p>PS：适用于 <code>&lt;input&gt;</code> 标签 type 属性值为：text、search、url、tel、email、password、datepickers、number、checkbox、radio、file</p>
<h2 id="链接新增属性"><a href="#链接新增属性" class="headerlink" title="链接新增属性"></a>链接新增属性</h2><ol>
<li><p><code>&lt;link&gt;</code> 的sizes</p>
</li>
<li><p><code>&lt;base&gt;</code> 的target</p>
<ul>
<li>base 标签如果设置了 target 属性，就可以控制整个页面所有超链接的跳转方式</li>
</ul>
</li>
<li><p><code>&lt;a&gt;</code> 标签</p>
<ul>
<li><p>media = “”（表示对设备进行优化，handheld 对“手持”设备进行支持，tv 对“电视”设备进行支持</p>
</li>
<li><p>hreflang = “zh”（设置语言，这里设置语言是中文）</p>
</li>
<li><p>rel = “external”（设置超链接的引用，这里超链接为外部链接）</p>
</li>
</ul>
</li>
</ol>
<h2 id="其他属性"><a href="#其他属性" class="headerlink" title="其他属性"></a>其他属性</h2><h3 id="script"><a href="#script" class="headerlink" title="script"></a>script</h3><ul>
<li><p>defer：规定当页面已完成加载后，才会执行脚本</p>
</li>
<li><p>async：规定一旦脚本可用，将会异步执行</p>
</li>
</ul>
<h3 id="ol"><a href="#ol" class="headerlink" title="ol"></a>ol</h3><table>
<thead>
<tr>
<th>属性</th>
<th>作用</th>
</tr>
</thead>
<tbody><tr>
<td>start</td>
<td>起始值</td>
</tr>
<tr>
<td>reversed</td>
<td>倒序排列</td>
</tr>
</tbody></table>
<h3 id="html"><a href="#html" class="headerlink" title="html"></a>html</h3><p>manifest = “cache.manifest”（定义页面离线应用文件）（引号中内容cache可更改）</p>
<blockquote>
<p><code>&lt;html manifest=&quot;cache.manifest&quot;&gt;</code></p>
</blockquote>
<h3 id="style"><a href="#style" class="headerlink" title="style"></a>style</h3><p>scoped：内嵌CSS</p>
<p>可以写在html文件的任意位置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;style scoped&gt;</span><br><span class="line">    ...</span><br><span class="line">&lt;/style&gt;</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/08/11/HTML进阶知识点-HTML5属性变化/" data-id="ck4r400pq0048l0w04cm565yz" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/HTML5/">HTML5</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/08/14/CSS进阶知识点-CSS3基本选择器及属性选择器/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          CSS进阶知识点--CSS3基本选择器及属性选择器
        
      </div>
    </a>
  
  
    <a href="/2019/08/10/HTML进阶知识点-HTML5标签变化/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">HTML进阶知识点--HTML5标签变化</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Ajax/">Ajax</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS/">CSS</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS3/">CSS3</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Dart/">Dart</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Flutter/">Flutter</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Git/">Git</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML/">HTML</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML5/">HTML5</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JSON/">JSON</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaScript/">JavaScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/QT/">QT</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/React/">React</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Sass/">Sass</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TypeScript/">TypeScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/bootstrap/">bootstrap</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Ajax/">Ajax</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS/">CSS</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS3/">CSS3</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dart/">Dart</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Flutter/">Flutter</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML/">HTML</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML5/">HTML5</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JSON/">JSON</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Javascript/">Javascript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/QT/">QT</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/React/">React</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sass/">Sass</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TypeScript/">TypeScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/bootstrap/">bootstrap</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Ajax/" style="font-size: 12.22px;">Ajax</a> <a href="/tags/CSS/" style="font-size: 18.89px;">CSS</a> <a href="/tags/CSS3/" style="font-size: 17.78px;">CSS3</a> <a href="/tags/Dart/" style="font-size: 14.44px;">Dart</a> <a href="/tags/Flutter/" style="font-size: 16.67px;">Flutter</a> <a href="/tags/Git/" style="font-size: 12.22px;">Git</a> <a href="/tags/HTML/" style="font-size: 14.44px;">HTML</a> <a href="/tags/HTML5/" style="font-size: 12.22px;">HTML5</a> <a href="/tags/JSON/" style="font-size: 10px;">JSON</a> <a href="/tags/Java/" style="font-size: 11.11px;">Java</a> <a href="/tags/JavaScript/" style="font-size: 20px;">JavaScript</a> <a href="/tags/Javascript/" style="font-size: 10px;">Javascript</a> <a href="/tags/QT/" style="font-size: 12.22px;">QT</a> <a href="/tags/React/" style="font-size: 15.56px;">React</a> <a href="/tags/Sass/" style="font-size: 11.11px;">Sass</a> <a href="/tags/TheKnowledgeOf/" style="font-size: 11.11px;">TheKnowledgeOf</a> <a href="/tags/TypeScript/" style="font-size: 10px;">TypeScript</a> <a href="/tags/bootstrap/" style="font-size: 11.11px;">bootstrap</a> <a href="/tags/jQuery/" style="font-size: 13.33px;">jQuery</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">May 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/12/29/Flutter-MaterialApp常用属性介绍/">Flutter-MaterialApp常用属性介绍</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-ListView/">Flutter-ListView</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-AppBar/">Flutter-AppBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-TabBar/">Flutter-TabBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-按钮/">Flutter-按钮</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>